pub mod generator;

use clap::Parser;
use serde::{Deserialize, Serialize};
use std::env::current_dir;
use std::process;

#[derive(Parser, Debug, Clone, Serialize, Deserialize)]
#[command(version, about, long_about = None)]
pub struct Args {
    /// 生成的目录名称，英文
    pub name: String,
}
pub fn check_folder_exists(args: &Args) -> anyhow::Result<()> {
    let folder_name = &args.name;
    let dir = current_dir()?;
    let output_folder = dir.join(folder_name);
    if output_folder.exists() {
        println!("文件夹已经存在:{output_folder:?}");
        process::exit(1);
    }
    Ok(())
}
